/*
 * @Description  : 
 * @Autor        : yanwang
 * @CreateDate   : 2021-11-25 17:19:49
 * @LastEditors  : yanwang
 * @LastEditTime : 2022-08-07 09:28:45
 */
var getKthMagicNumber = function (k) {
  var p3 = 0;
  var p5 = 0;
  var p7 = 0;
  var arr = [1];
  for (var i = 1; i < k; i++) {
    arr[i] = Math.min(arr[p3] * 3, arr[p5] * 5, arr[p7] * 7);
    if (arr[i] === arr[p3] * 3) p3++;
    if (arr[i] === arr[p5] * 5) p5++;
    if (arr[i] === arr[p7] * 7) p7++;
  }
  return arr[k - 1]
};